﻿using System;
using RSSReader.classesCustom;
using System.Web.Script.Serialization;
using System.Web.Services;
using System.Web.Script.Services;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.IO;

namespace RSSReader._testPages
{
    public partial class WebForm2 : System.Web.UI.Page
    {        

        protected void Page_Load(object sender, EventArgs e)
        {
        
        }

        [WebMethod]        
        public static Article GetArticle()
        {
            JavaScriptSerializer js = new JavaScriptSerializer();
            String str = js.Serialize(Global.dh2.onlineArticles[0]);

            return Global.dh2.onlineArticles[0];

            //return "<p>This is Istvan</p>";

            //return DateTime.Now.ToString();

        }

        //[WebMethod]
        //[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        //public static String Abc()
        //{
            
        //    JavaScriptSerializer js = new JavaScriptSerializer();
        //    String str = js.Serialize(Global.dh2.onlineArticles);

        //    List<Article> l = Global.dh2.onlineArticles;
        //    XmlSerializer ser = new XmlSerializer(l.GetType());
        //    StringWriter writer = new StringWriter();
        //    ser.Serialize(writer,l);
        //    String str2 = writer.ToString();

        //    //Article[] ret = Global.dh2.onlineArticles.ToArray();
        //    return str;            

        //    //return "<p>This is Istvan</p>";

        //    //return DateTime.Now.ToString();
            
        //}
    }
}